<extend name="Public/base"/>

<block name="body">
    <div class="main-title">
        <h2><if condition="ACTION_NAME eq 'add'">新建<else/>编辑</if>推广费用</h2>
    </div>

    <form action="{:U()}" id="commentForm" method="post"  class="form-horizontal" >
    <!-- 判断插入ID是否为空，如不为空隐藏插入ID值 -->
        <notempty name="data['id']">
            <input type="hidden" name="id" value="{$data['id']}"/>
        </notempty>
        <div class="form-item">
            <label class="item-label">时间<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="time" onclick="laydate()" value="<if condition="ACTION_NAME eq 'add'"><else/>{$data.time|date="Y-m-d",###}</if>" >
            </div>
        </div>			
        <div class="form-item">
            <label class="item-label">百度推广<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="baidu"  value="<if condition="ACTION_NAME eq 'add'">0<else/>{$data.baidu}</if>" >
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">360推广<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="so"  value="<if condition="ACTION_NAME eq 'add'">0<else/>{$data.so}</if>" >
            </div>
        </div>
		<div class="form-item">
            <label class="item-label">Google<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="google"  value="<if condition="ACTION_NAME eq 'add'">0<else/>{$data.google}</if>" >
            </div>
        </div>
		<div class="form-item">
			<label class="item-label">搜狗<span class="check-tips"></span></label>
			<div class="controls">
				<input type="text" class="text input-large" name="sogou"  value="<if condition="ACTION_NAME eq 'add'">0<else/>{$data.sogou}</if>" >
			</div>
		</div>
		<div class="form-item">
            <label class="item-label">大众点评<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="dazhong"  value="<if condition="ACTION_NAME eq 'add'">0<else/>{$data.dazhong}</if>" >
            </div>
        </div>
		<div class="form-item">
            <label class="item-label">微博<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="weibo"  value="<if condition="ACTION_NAME eq 'add'">0<else/>{$data.weibo}</if>" >
            </div>
        </div>
		<div class="form-item">
            <label class="item-label">微信<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="weixin"  value="<if condition="ACTION_NAME eq 'add'">0<else/>{$data.weixin}</if>" >
            </div>
        </div>
		<div class="form-item">
            <label class="item-label">天猫<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="tianmao"  value="<if condition="ACTION_NAME eq 'add'">0<else/>{$data.tianmao}</if>" >
            </div>
        </div>
		<div class="form-item">
            <label class="item-label">神马<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="smtg"  value="<if condition="ACTION_NAME eq 'add'">0<else/>{$data.smtg}</if>" >
            </div>
        </div>
		<div class="form-item">
            <label class="item-label">顾客推荐<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="laoguketj"  value="<if condition="ACTION_NAME eq 'add'">0<else/>{$data.laoguketj}</if>" >
            </div>
        </div>
		<div class="form-item">
            <label class="item-label">员工推荐<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="yuangongtj"  value="<if condition="ACTION_NAME eq 'add'">0<else/>{$data.yuangongtj}</if>" >
            </div>
        </div>		
		<div class="form-item">
            <label class="item-label">广点通<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="gdt"  value="<if condition="ACTION_NAME eq 'add'">0<else/>{$data.gdt}</if>" >
            </div>
        </div>	
		<div class="form-item">
            <label class="item-label">小红书<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="xhs"  value="<if condition="ACTION_NAME eq 'add'">0<else/>{$data.xhs}</if>" >
            </div>
        </div>	
		<div class="form-item">
            <label class="item-label">美柚<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="my"  value="<if condition="ACTION_NAME eq 'add'">0<else/>{$data.my}</if>" >
            </div>
        </div>	
		<div class="form-item">
            <label class="item-label">婚礼纪<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="hlj"  value="<if condition="ACTION_NAME eq 'add'">0<else/>{$data.hlj}</if>" >
            </div>
        </div>	
		<div class="form-item">
            <label class="item-label">其他<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="qt"  value="<if condition="ACTION_NAME eq 'add'">0<else/>{$data.qt}</if>" >
            </div>
        </div>	
        <div class="form-item">
            <button class="btn submit-btn" id="submit" type="submit" target-form="form-horizontal">确 定</button>
            <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
        </div>
    </form>


   
</block>

<block name="script">
    <script src="__STATIC__/thinkbox/laydate.js"></script>
	<script>
		  $("form").submit(function(){
            var self = $(this);
            $.post(self.attr("action"), self.serialize(), success, "json");
            return false;

            function success(data){
                if(data.status){
					$(".alert-content").html(data.info);
					$("#top-alert").addClass('alert-success').show();
					setTimeout(function () { 
                       window.location.href = data.url;
                    }, 3000);
                } else {
                       $(".alert").show();
                    setTimeout(function () { 
                       $(".alert").hide();
                    }, 3000);
                }
            }
        });
	</script>
    <script type="text/javascript">
        //导航高亮
        highlight_subnav('{:U('Tuig/index')}');
    </script>
</block>
